package com.masterclient.app.modules.income;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.eoner.baselib.utils.toast.ToastUtil;
import com.eoner.managerlibrary.router.AroutePath;
import com.masterclient.app.BaseFragment;
import com.masterclient.app.R;
import com.masterclient.app.modules.income.adapter.ClearAccountAdapter;
import com.masterclient.app.modules.shop.beans.DealerBean;
import com.masterclient.app.modules.shop.contract.DealerContract;
import com.masterclient.app.modules.shop.contract.DealerPresenter;

import java.util.Objects;

import butterknife.BindView;
import butterknife.OnClick;

@Route(path = AroutePath.CLEAR_ACCOUNT_DETAILS_FRAGMENT)
public class ClearAccountDetailsFragment extends BaseFragment<DealerPresenter> implements DealerContract.View {

    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.recyclerView)
    RecyclerView recyclerView;

    private ClearAccountAdapter adapter;

    public static ClearAccountDetailsFragment newInstance() {
        return new ClearAccountDetailsFragment();
    }

    @Override
    protected View getRootView(LayoutInflater inflater) {
        return inflater.inflate(R.layout.fragment_clear_account_details, null);
    }

    @Override
    protected void initOnlyOnce() {
        super.initOnlyOnce();

        tvTitle.setText("结算单");
//        recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
//        adapter = new ClearAccountAdapter();
//        recyclerView.setAdapter(adapter);
//        adapter.bindToRecyclerView(recyclerView);
//
//        View footView = View.inflate(mContext, R.layout.item_clear_account_footer, null);
//        TextView tvNickName = footView.findViewById(R.id.tv_nick_name);
//        TextView tvAccount = footView.findViewById(R.id.tv_account);
//        TextView tvCreateTime = footView.findViewById(R.id.tv_create_time);
//        TextView tvDesc = footView.findViewById(R.id.tv_desc);
//        adapter.setFooterView(footView);
//
//        list.add(new IncomeCommissionOrderListBean());
//        list.add(new IncomeCommissionOrderListBean());
//        list.add(new IncomeCommissionOrderListBean());
//        adapter.setNewData(list);
    }

    @Override
    public void onResume() {
        super.onResume();
    }

    @OnClick({R.id.back})
    void onClick(View view) {
        if (view.getId() == R.id.back) {
            Objects.requireNonNull(getActivity()).finish();
        }
    }

    @Override
    public void showData(DealerBean dataBean) {

    }

    @Override
    public void showDataFailed(String msg) {
        ToastUtil.showToast(msg);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
    }
}
